# Contributor: Orhun Parmaksız <orhunparmaksiz@gmail.com>
# Maintainer: Orhun Parmaksız <orhunparmaksiz@gmail.com>
pkgname=watchbind
pkgver=0.2.0
pkgrel=0
pkgdesc="Turn any shell command into a powerful TUI with custom keybindings"
url="https://github.com/fritzrehde/watchbind"
arch="all"
license="GPL-3.0-or-later"
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/fritzrehde/watchbind/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
ffbc62253427e168e724e9fe13f0cdbc6219aa6ca80c7a16663f8a43573f8c9afd62e3032a2d4209bc379200f8a409b59725d9c6296919994de3b9f1b106b277  watchbind-0.2.0.tar.gz
"
